import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    LoginShow: false,
    ToastShow: false
  },
  getters: {
  },
  mutations: {
    ChangeLoginShow(state, payload) {
      state.LoginShow = payload
    },
    OpenToastShow(state) {
      state.ToastShow = true
    },
    CloseToastShow(state) {
      state.ToastShow = false
    },
  },
  actions: {
    AsyncToast({
      commit
    }) {
      commit('OpenToastShow');
      setTimeout(() => {
        commit('CloseToastShow')
      }, 2000)
    }
  },
  modules: {
  }
})
